﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Pay.Data {
	public partial class BillMap
		: System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<Bill> {
		public BillMap() {
			// table
			ToTable("mc_Bill", "dbo");

			// keys
			HasKey(t => t.Id);

			// Properties
			Property(t => t.Id)
				.HasColumnName("Id")
				.HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
				.IsRequired();
			Property(t => t.MerchantId)
				.HasColumnName("MerchantId")
				.IsRequired();
			Property(t => t.Balance)
				.HasColumnName("Balance")
				.HasPrecision(18, 6)
				.IsRequired();
			Property(t => t.Unconfirmed)
				.HasColumnName("Unconfirmed")
				.HasPrecision(18, 6)
				.IsRequired();
			Property(t => t.Deposited)
				.HasColumnName("Deposited")
				.HasPrecision(18, 6)
				.IsRequired();
			Property(t => t.Depositeding)
				.HasColumnName("Depositeding")
				.HasPrecision(18, 6)
				.IsRequired();
			Property(t => t.Deposit)
				.HasColumnName("Deposit")
				.HasPrecision(18, 6)
				.IsRequired();
			Property(t => t.Freeze)
				.HasColumnName("Freeze")
				.IsRequired();
            Property(t=>t.GoodsUnconfirmed)
                .HasColumnName("GoodsUnconfirmed")
                .HasPrecision(18, 6)
                .IsRequired();
            Property(t => t.GoodsDeposit)
                .HasColumnName("GoodsDeposit")
                .HasPrecision(18, 6)
                .IsRequired();
            Property(t => t.GoodsDepositing)
                .HasColumnName("GoodsDepositing")
                .HasPrecision(18, 6)
                .IsRequired();
            Property(t=>t.GoodsDeposited)
                .HasColumnName("GoodsDeposited")
                .HasPrecision(18, 6)
                .IsRequired();
            Property(t => t.Security)
				.HasColumnName("Security")
				.HasPrecision(18, 6)
				.IsRequired();
			Property(t => t.OutProfit)
				.HasColumnName("OutProfit")
				.HasPrecision(18, 6)
				.IsRequired();
			Property(t => t.OtherAmt)
				.HasColumnName("OtherAmt")
				.HasPrecision(18, 6)
				.IsRequired();

			// Relationships
			HasRequired(t => t.Merchant)
				.WithMany()
				.HasForeignKey(d => d.MerchantId)
				.WillCascadeOnDelete(false);
		}
	}
}
